home *** CD-ROM | disk | FTP | other *** search
-
-
- program convert(input,output);
-
-
- type wstype = char;
-
-
- var infile : file of wstype;
- outfile : text;
- in1 : char;
-
- label stop_here, start_again;
-
- {$I arglist.pas}
-
-
-
- begin
- if argc <2 then
- begin
- writeln('Wordstar file conversion');
- writeln('WSCONV wsfile.ext textfile.ext');
- writeln('Press any key...');
- repeat until keypressed;
- goto stop_here;
- end;
- writeln('working');
- assign(infile,argv(1));
- assign(outfile,argv(2));
- reset(infile);
- rewrite(outfile);
- while not eof(infile) do
- begin
- read(infile,in1);
- while in1 = chr(27) do
- begin
- read(infile,in1);
- read(infile,in1);
- end;
- if ord(in1) > 128 then
- in1 := chr(ord(in1)-128);
- if in1 in [chr(0)..chr(11),chr(12),chr(14)..chr(26)] then
- goto start_again;
- if (in1 in [chr(11),chr(13)]) then
- writeln(outfile,'')
- else
- write(outfile,in1);
- start_again:
- end;
- close(infile);
- close(outfile);
- stop_here:
- end.